<div class="container wenku-main">
    {{/*SEO优化需要，这里的文本内容不需要展示给用户看*/}}
        <div class="zero-height">{{.Content}}</div>

        <div class="row">
        <div class="col-xs-9 wenku-left wenku-nopadding">

            <div class="panel panel-default wenku-noborder">
                <div class="panel-body">
                    <h1>
                        <img alt="{{.Doc.Ext}}文档" src="/static/Home/default/img/{{.Doc.ExtCate}}_24.png"/> {{.Doc.Title}}
                        {{if gt $.AdminId 0}}
                        <a href="/admin/doc/action?type=remove&id={{.Doc.Id}}" class="text-muted wenku-tooltip wenku-ajax-get" title="将文档移入回收站"><i class="fa fa-recycle"></i></a>
                        {{end}}
                    </h1>
                    <div class="help-block wenku-doc-info">
							<span>
								<a href="/list/{{.Breadcrumb.Chanel.Alias}}" title="{{.Breadcrumb.Chanel.Title}}">{{.Breadcrumb.Chanel.Title}}</a> >
								<a href="/list/{{.Breadcrumb.Chanel.Alias}}/pid/{{.Breadcrumb.Parent.Id}}" title="{{.Breadcrumb.Parent.Title}}">{{.Breadcrumb.Parent.Title}}</a> >
								<a href="/list/{{.Breadcrumb.Chanel.Alias}}/pid/{{.Breadcrumb.Parent.Id}}/cid/{{.Breadcrumb.Child.Id}}" title="{{.Breadcrumb.Child.Title}}">{{.Breadcrumb.Child.Title}}</a> >
								<span class="text-muted">文档预览</span>
							</span>
                        <div class="pull-right text-muted">
                            <span title="页数"><i class="fa fa-file-text-o"></i> {{HandlePageNum .Doc.Page}} 页</span>
                            <span title="下载"><i class="fa fa-download"></i> {{.Doc.Dcnt}} 下载</span>
                            <span title="浏览"><i class="fa fa-eye"></i> {{.Doc.Vcnt}} 浏览</span>
                            <span title="评论"><i class="fa fa-comments-o"></i> {{.Doc.ScorePeople}} 评论</span>
                            <span title="收藏"><i class="fa fa-heart-o"></i> {{.Doc.Ccnt}} 收藏</span>
                            <span title="评分"><i class="wenku-star star-{{StarVal .Doc.Score false}}"></i> {{StarVal .Doc.Score true}}分</span>
                        </div>
                    </div>

                    <!--<div class="help-block wenku-preview-tips">温馨提示：如果当前文档出现乱码或未能正常浏览，请先下载原文档进行浏览。</div>-->
                    {{if $.ViewAll}}
                        <div class="help-block wenku-preview-tips">温馨提示：如果当前文档出现乱码或未能正常浏览，请先下载原文档进行浏览。</div>
                    {{else}}
                        <div class="help-block wenku-preview-tips">
                            温馨提示：当前文档最多只能预览 <span class="strong text-primary">{{.Doc.PreviewPage}}</span> 页，若文档总页数超出了 <span class="strong text-primary">{{.Doc.PreviewPage}}</span> 页，请下载原文档以浏览全部内容。
                        </div>
                    {{end}}


                    <div class="wenku-viewer" id="wenku-viewer" data-scale="9">
                        {{range $index,$el:=.PreviewPages}}
                            {{if gt $index 1}}
                            <img src="/static/Common/img/loading.gif" data-original="{{$.PreviewDomain}}/{{$.Doc.Md5}}/{{CalcInt $index "+" 1}}.{{Default $.Doc.PreviewExt "svg"}}" class="wenku-lazy wenku-viewer-img wenku-page{{CalcInt $index "+" 1}}" data-page="{{CalcInt $index "+" 1}}" alt="{{$.Doc.Title}} 第 {{CalcInt $index "+" 1}} 页">
                            {{else}}
                            <img src="{{$.PreviewDomain}}/{{$.Doc.Md5}}/{{CalcInt $index "+" 1}}.{{Default $.Doc.PreviewExt "svg"}}" class="wenku-lazy wenku-viewer-img wenku-page{{CalcInt $index "+" 1}}" data-page="{{CalcInt $index "+" 1}}" alt="{{$.Doc.Title}} 第 {{CalcInt $index "+" 1}} 页">
                            {{end}}
                        {{end}}

                        {{if gt $.Doc.Page $.PageShow}}
                        <div class="wenku-viewer-more text-center" data-next="{{CalcInt $.PageShow "+" 1}}" data-ext="{{Default $.Doc.PreviewExt "svg"}}" data-svg="{{$.PreviewDomain}}/{{$.Doc.Md5}}/">

                        {{if gt .Doc.Price -1}}
                            <div>下载文档到电脑，方便使用</div>
                            <div><a href="javascript:void(0);" class="btn btn-primary" data-toggle="modal" data-target="#ModalDownload"><i class="fa fa-cloud-download"></i> 下载文档</a></div>
                        {{end}}

                        {{if $.ViewAll}}
                            <a href="javascript:void(0);" class="wenku-viewer-more-btn">
                                <div class="help-block">
                                还有 <span class="wenku-unread-pages">{{CalcInt $.Doc.Page "-" $.PageShow}}</span> 页可预览，<span class="text-primary">继续阅读</span>
                                </div>
                            </a>
                        {{else}}
                            <a href="javascript:void(0);" class="wenku-viewer-more-btn">
                                <div class="help-block">
                                    当前文档最多只能预览 {{.Doc.PreviewPage}} 页 <br>
                                    还有 <span class="wenku-unread-pages">{{CalcInt $.Doc.PreviewPage "-" $.PageShow}}</span> 页可预览，<span class="text-primary">继续阅读</span>
                                </div>
                            </a>
                        {{end}}
                            <div class="help-block"><a href="javascript:void(0);" class="wenku-viewer-more-btn"><i class="fa fa-angle-down"></i></a></div>
                        </div>
                        {{end}}



                    </div>



                    <div class="help-block">
                        <span>本文档由 <a href="/user/{{.Doc.Uid}}" target="_blank"title="{{.Doc.Username}}">{{.Doc.Username}}</a> 于 <span class="text-muted">{{TimestampFormat .Doc.TimeCreate}}</span>上传分享</span>
                    </div>
                    <div class="help-block wenku-action">
                        <div class="pull-left">
                            <a href="javascript:void(0);" data-toggle="modal" data-target="#ModalReport" class="btn btn-primary btn-sm"><i class="fa fa-warning"></i> 举报</a>
                        </div>
                        <div class="pull-right wenku-mgl-15px">
                            {{if gt .Doc.Price -1}}
                            <a href="javascript:void(0);" rel="nofollow" data-toggle="modal" data-target="#ModalDownload" target="_blank" class="btn btn-primary btn-sm"><i class="fa fa-cloud-download"></i> 下载<span class="hidden-xs">原文档</span>({{FormatByte .Doc.Size}})</a>
                                    {{else}}
                            <a href="javascript:void(0);" rel="nofollow" class="btn btn-primary btn-sm disabled"><i class="fa fa-cloud-download"></i> 下载<span class="hidden-xs">原文档</span>({{FormatByte .Doc.Size}})</a>
                                    {{end}}
                        </div>
                        <div class="pull-right">
                            {{if DoesCollect .Doc.Id .LoginUid}}
                            <a href="javascript:void(0);" rel="nofollow" class="btn btn-primary btn-sm wenku-collect disabled"><i class="fa fa-heart-o"></i> <span>已收藏</span></a>
                            {{else}}
                            <a href="javascript:void(0);" rel="nofollow" class="btn btn-primary btn-sm wenku-collect"><i class="fa fa-heart-o"></i>  <span>收藏</span></a>
                            {{end}}
                            <a href="javascript:void(0);" data-toggle="modal" data-target="#ModalShare" class="btn btn-primary btn-sm"><i class="fa fa-share-alt"></i> 分享</a>
                        </div>
                    </div>


                </div>
            </div>

            <!--评分评论-->
            {{template "Comment" .}}

        </div>
        <div class="col-xs-3 wenku-right">


            {{if .Hots}}
            <div class="panel panel-default wenku-noborder wenku-maylike">
                <div class="panel-heading">
                    <div class="strong">热门文档</div>
                </div>
                <div class="panel-body">

                    <ul class="wenku-tabs-list">
                        {{range .Hots}}
                        <li><img alt="{{.Ext}}文档" src="/static/Home/default/img/{{.ExtCate}}_24.png"/><a href="/view/{{.Id}}" target="_blank" title="{{.Title}}">{{.Title}}</a></li>
                        {{end}}
                    </ul>
                </div>
            </div>
            {{end}}

            <div class="panel panel-default wenku-noborder wenku-maylike">
                <div class="panel-heading">
                    <div class="strong">最新文档</div>
                </div>
                <div class="panel-body">

                    <ul class="wenku-tabs-list">
                        {{range .Latest}}
                        <li><img alt="{{.Ext}}文档" src="/static/Home/default/img/{{.ExtCate}}_24.png"/><a href="/view/{{.Id}}" target="_blank" title="{{.Title}}">{{.Title}}</a></li>
                        {{end}}
                    </ul>

                </div>
            </div>

        </div>
    </div>
</div>


<div class="container-fluid navbar-default navbar-fixed-bottom" role="navigation">
    <div class="container">
        <div class="row">
            <div class="col-xs-9">
                <ul class="nav navbar-nav">
                    <li><a href="javascript:void(0);" class="wenku-expend"><i class="fa fa-arrows-alt em14"></i>&nbsp;</a></li>


                    <li><a href="javascript:void(0);" data-toggle="modal" data-target="#ModalShare"><i class="fa fa-share-alt em14"></i>&nbsp;</a></li>
                    <li><a href="javascript:void(0);" class="wenku-collect"><i class="fa fa-heart-o em14"></i>&nbsp;</a></li>
                    <li class="hidden-xs"><a href="javascript:void(0);" class="wenku-scale-minus"><i class="fa fa-search-minus em14"></i>&nbsp;</a></li>
                    <li class="hidden-xs"><a href="javascript:void(0);" class="wenku-scale-plus"><i class="fa fa-search-plus em14"></i>&nbsp;</a></li>



                    <li class="wenku-mgl-15px"><a href="javascript:void(0);" class="wenku-page-prev"><i class="fa fa-chevron-up em14"></i></a></li>
                    <p class="navbar-text"> <span class="wenku-current-page">1</span> /
                        {{if gt .Doc.PreviewPage 0}}
                            <span class="wenku-total-page hide">{{.Doc.PreviewPage}}</span>
                            <!--仍然显示全部页数，但是用于计算的是当前允许预览的最大页数-->
                            <span class="">{{HandlePageNum .Doc.Page}}</span>
                        {{else}}
                            <span class="wenku-total-page">{{HandlePageNum .Doc.Page}}</span>
                        {{end}}
                    </p>
                    <li class="wenku-mgr-15px"><a href="javascript:void(0);" class="wenku-page-next"><i class="fa fa-chevron-down em14"></i></a></li>



                    <li><a href="javascript:void(0);" class="wenku-goto-comment"><i class="fa fa-comments-o em14"></i> 评价文档</a></li>

                </ul>
                <ul class="nav navbar-nav navbar-right">
                    {{if gt .Doc.Price -1}}
                    <div class="navbar-text"><i class="fa fa-database"></i>&nbsp;&nbsp;{{.Doc.Price}}&nbsp;&nbsp;个金币 </div>
                    <li class="active" data-toggle="modal" data-target="#ModalDownload"><a href="javascript:void(0);"><i class="fa fa-cloud-download em14"></i> 下载文档({{FormatByte .Doc.Size}})</a></li>
                    {{else}}
                        <div class="navbar-text"><span class="text-danger">不允许下载&nbsp;</span>&nbsp;</div>
                        <li class="active active-forbidden"><a href="javascript:void(0);"><i class="fa fa-cloud-download em14"></i> 下载文档({{FormatByte .Doc.Size}})</a></li>
                    {{end}}
                </ul>
            </div>
            <div class="col-xs-3">
                <ul class="nav navbar-nav navbar-right wenku-up-to-top">
                    <li class="active go-top"><a href="javascript:void(0);"><i class="fa fa-arrow-up em14"></i> 回到顶部</a></li>
                </ul>
            </div>
        </div>
    </div>
</div>


{{template "ModalDownload" .}}
{{template "ModalShare" .}}
{{template "ModalReport" .}}
{{template "ModalCollect" .}}